<template>
  <div>
    <setting-header :isLogin="isLogin" />
    <setting-menu />
  </div>
</template>

<script>
import settingHeader from './tab-setting-header'
import settingMenu from './tab-setting-menu'
import { mapMutations } from 'vuex'

export default {
  data () {
    return {
      isLogin: false
    }
  },

  activated () {
    this.getLoginStatus()
  },
  mounted () {
    this.setActiveTab(3)
  },
  methods: {
    getLoginStatus () {
      this.isLogin =
        !!localStorage.getItem('token') &&
        !!localStorage.getItem('username')
    },
    ...mapMutations({
      setActiveTab: 'tabbar/setActiveTab'
    })
  },

  components: {
    [settingHeader.name]: settingHeader,
    [settingMenu.name]: settingMenu
  }
}
</script>

<style scoped>

</style>
